package application.ratt.city_model;

import java.util.ArrayList;
import java.util.List;

public class Line {
	private String id;
	private String name;
	private List<String> firstDirectionStationIDs;
	private List<String> secondDirectionStationIDs;

	public Line() {
		firstDirectionStationIDs = new ArrayList<String>();
		secondDirectionStationIDs = new ArrayList<String>();
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public void addStationToFirstDirection(String s) {
		firstDirectionStationIDs.add(s);
	}

	public void addStationToSecondDirection(String s) {
		secondDirectionStationIDs.add(s);
	}

	public List<String> getStationsForStation(Station station) {
		for (String s : firstDirectionStationIDs) {
			if (s.equals(station.getId())) {
				return firstDirectionStationIDs;
			}
		}

		for (String s : secondDirectionStationIDs) {
			if (s.equals(station.getId())) {
				return secondDirectionStationIDs;
			}
		}

		return null;
	}

}
